<gm:page title="Sample - RSS Feed" authenticate="false">
  
  
  
<form name="tagForm">
<input name="tag" type="text" value="bikes" style="width:250px" size=20/>
<input type="button" value="search videos" style="background: #286ea0; color: #FFFFFF; font-size: 12px; font-weight: bold"
onClick="getVideosByTag();"/>
</form>  

<div id="message" style="background: #286ea0; color: #FFFF00; font-size: 14px; font-weight: bold>
<b>hui</b>
<span/>
</div>

<script>
function writeMessage(message){
	document.getElementById("message").innerHTML = message;
}
  
</script>

<table>
<tr>
<td>   
<gm:list id="videosList"
data="http://pipes.yahoo.com/pipes/pipe.run?_id=2bb3b825d2a4cca638baa56607539665&_render=rss&results=30&search=bikes"
 pagesize="10" template="videosTemplate"> 
 <gm:handleEvent event="select" execute="videoListSelect();"/>  
</gm:list>
</td>
<td>
<div id="details">
<b>details</b>
<span/>
</div>
  
</td>  
</tr>
</table>              

<script>
function writeDetails(message){
	document.getElementById("details").innerHTML = message;
}
  
</script>



 <script>
    function videoListSelect(){
     var listModule = google.mashups.getObjectById('videosList');  
     var titleGPath = new GPath('atom:title');      
     var listEntry=listModule.getSelectedEntry();
     var originalTitle = titleGPath.getValue(listEntry);     
     writeMessage(originalTitle);
     var summaryGPath = new GPath('atom:player');      
     var originalSummary = summaryGPath.getValue(listEntry);     
     
          writeDetails(originalSummary);
    }
</script>  

  <gm:template id="videosTemplate">
    <table class="blue-theme">
      <tr repeat="true">
        <td><gm:text ref="atom:title"/><span/><gm:text ref="atom:modified"/></td>
      </tr>
      <tfoot>
        <tr>
          <td align="center"><gm:pager compact="true"/></td>
        </tr>
      </tfoot>
    </table>
  </gm:template>



<script>
    function getVideosByTag(){  
      var tag = document.tagForm.tag.value;
      if(tag!=null && tag!=""){
        tag = tag.replace(/ /g,'%2B');
        var vidModule = google.mashups.getObjectById('videosList');    
        var url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=d8a82825001c36eb8d72932f698932c2&_render=rss&results=30&search='+tag.toString();
        vidModule.setData(url);
      }
      else {
        alert('Enter a search string');
      }
      return false;
    }
    

</script>


</gm:page>